﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>App</title>
    <style>
        
        .Menu div       {padding:5px; border-radius:5px}
        .Menu .Item:hover {background-color:#dddddd; cursor:pointer}
        .imgSpan    {width:16px; height:16px; display:inline-block}
        
        .createList div
        {
            padding-left:40px;
            
        }
        
        .createList
        {
            display:none;
        }
        
        .icon-task  
        {
            background:url('/images/iconTask.jpg') no-repeat;
        }
        
        .icon-time  
        {
            background: url(/Images/16_icons.gif) no-repeat;
            background-position: 0px -1055px;
        }
        
        .icon-bug
        {
            background:url('/images/icons/ico-bug-16px.png') no-repeat;
        }

        .icon-risk
        {
            background:url('/images/risk.png') no-repeat;
        }

        .icon-issue
        {
            background:url('/images/issues.png') no-repeat;
        }

        .icon-request
        {
            background:url('/images/request.png') no-repeat;
        }
        
        .icon-draft
        {
            background:url('/images/16_icons.gif') no-repeat -165px -1152px;
        }
    </style>
    <script language="javascript" type="text/javascript" src="https://api.conduit.com/BrowserCompApi.js"></script>
    <script>
    var og_f = "resizable=1, openposition=center, savelocation=0, saveresizedsize=0, NativeFrame=1";

    function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

    function OpenUrl(endUrl)
    {
        var width = 790;
        var height = 530;
        
        endUrl = "@(Logic.Constants.CurrentUrl)" + endUrl + "?accessToken=" + readCookie ("access_token");

        // hack for chrome because conduit has a proble with opening https in chrome
        if (navigator.userAgent.toLowerCase().indexOf('chrommmmme') > -1)
        {
            url = "@(Logic.Constants.CurrentUrl.Replace("https://","http://"))" + "/conduit/ChromeLandingPage?url=" + escape(endUrl);
            OpenGadget(url, width, height, og_f);
        }
        else
        {
            OpenGadget(endUrl, width, height, og_f);
        }

    }
    </script>
    <script src="@(Logic.Constants.CurrentUrl)/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>

</head>
<body>
    <div style="width:200px" class="Menu">
        <div onclick="OpenUrl('/tasks/index')" class="Item"><span class="imgSpan icon-task"></span> Tasks</div>
        <div onclick="OpenUrl('/timesheet/edit')" class="Item"><span class="imgSpan icon-time"></span> Time</div>

        <div class="Item" onclick="debugger;$('.createList').fadeToggle()"><span class="imgSpan icon-draft"></span>Create</div>
        <div class="createList">
            <div class="Item" onclick="OpenUrl('/tasks/create')"><span class="imgSpan icon-task"></span> Task</div>
            <div class="Item" onclick="OpenUrl('/bug/create')"><span class="imgSpan icon-bug"></span> Bug</div>
            <div class="Item" onclick="OpenUrl('/issues/create')"><span class="imgSpan icon-issue"></span> Issue</div>
            <div class="Item" onclick="OpenUrl('/risk/create')"><span class="imgSpan icon-risk"></span> Risk</div>
            <div class="Item" onclick="OpenUrl('/request/create')"><span class="imgSpan icon-request"></span> Request</div>
        </div>
    </div>
</body>
</html>
